package com.mudongheng.app.util;

import cn.dev33.satoken.secure.SaSecureUtil;

/**
 * @author 幕冬
 * @since 2021年10月26日
 */
public class PasswordEncoderUtil {

    private final static String KEY = "sFojgweg2!%#5g1gedss";

    public static String encode(String password) {
        return SaSecureUtil.aesEncrypt(KEY, password);
    }

    public static boolean matches(String rawPassword, String encoderPassword) {
        return rawPassword.equals(SaSecureUtil.aesDecrypt(KEY, encoderPassword));
    }
}
